//
//  NoMoreMsgView.m
//  Bread-Live
//
//  Created by ios on 2017/3/13.
//  Copyright © 2017年 Chris. All rights reserved.
//

#import "NoMoreMsgView.h"

@interface NoMoreMsgView ()

@property(nonatomic,strong) UILabel *titleLabel;
@property(nonatomic,strong) UIView  *joinView;

@end

@implementation NoMoreMsgView


-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self configView];
    }
    return self;
}


-(void)configView{
    
    CGFloat viewW = self.frame.size.width;
    CGFloat viewH = self.frame.size.height;
    
    _titleLabel                = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, viewW, viewH*0.2)];
    _titleLabel.text           = @"————— 我是底线，没有更多啦 —————";
    _titleLabel.font           = [UIFont wyNormalFot:12];
    _titleLabel.textAlignment  = NSTextAlignmentCenter;
    _titleLabel.textColor      = WYCOLOR(147, 146, 147, 1.0);
    
    [self addSubview:_titleLabel];
    
    _joinView         = [[UIView alloc] initWithFrame:CGRectMake(20, viewH*0.25, viewW-40, viewH*0.65)];
    
    CGFloat  joinViewW = _joinView.frame.size.width;
    CGFloat  joinViewH = _joinView.frame.size.height;
    
    
    UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0,joinViewW,joinViewH) byRoundingCorners:UIRectCornerTopRight | UIRectCornerTopLeft cornerRadii:CGSizeMake(20, 0)];
    CAShapeLayer *layer = [CAShapeLayer layer];
    layer.bounds        = CGRectMake(0, 0, joinViewW, joinViewH);
    layer.position      = CGPointMake(joinViewW/2, joinViewH/2);
    layer.strokeColor   = [UIColor clearColor].CGColor;
    layer.fillColor     = WYCOLOR(255, 237, 167, 1.0).CGColor;
    layer.path          = path.CGPath;
    
    [_joinView.layer addSublayer:layer];
    
    [self addSubview:_joinView];
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapClick)];
    
    [_joinView addGestureRecognizer:tap];
    
    UILabel * bigLabel       = [[UILabel alloc] initWithFrame:CGRectMake(0, joinViewH*0.1, joinViewW, joinViewH*0.4)];
    bigLabel.text            = @"想要参加TA的直播？";
    bigLabel.font            = [UIFont wyBlodFont:15];
    bigLabel.textColor       = WYCOLOR(102, 102, 102, 1.0);
    bigLabel.textAlignment   = NSTextAlignmentCenter;
    [_joinView addSubview:bigLabel];
    
    UILabel * smallLabel       = [[UILabel alloc] initWithFrame:CGRectMake(0, joinViewH*0.6, joinViewW, joinViewH*0.3)];
    smallLabel.text            = @"告诉我们，说不定我们能邀请到呢";
    smallLabel.textAlignment   = NSTextAlignmentCenter;
    smallLabel.font            = [UIFont wyNormalFot:12];
    smallLabel.textColor       = WYCOLOR(147, 146, 147, 1.0);
    [_joinView addSubview:smallLabel];
    
}

-(void)tapClick{
    
    NSLog(@"按钮跳转");
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
